#include<iostream>
using namespace std;
#include<algorithm>
#include<functional>
#include<numeric>
#include<vector>


void print01(int a){
    printf("%d\n",a);
}

int main(){
    vector<int> v,v2,v3;
    for(int i=0;i<=10;++i){
        v.push_back(i);
    }
    for_each(v.begin(),v.end(),print01);


v2.push_back(1);
v2.push_back(2);
v2.push_back(3);
v2.push_back(1);
v2.push_back(3);
v2.push_back(1);
v2.push_back(1);
v2.push_back(1);

vector<int>::iterator it= adjacent_find(v2.begin(),v2.end());

cout<<*it<<endl;

bool has=binary_search(v.begin(),v.end(),5);
it=upper_bound(v.begin(),v.end(),5);

cout<<has<<endl;

cout<<*it<<endl;


    return 0;
}